package com.gc.server.dao;

import com.gc.server.entity.GoodsApplyEntity;
import com.gc.server.vo.GoodsApplyVo;
import org.apache.ibatis.annotations.Mapper;
import com.yf.dao.BaseDao;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 物料申请Dao
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Tue Mar 10 11:17:45 CST 2020
 */
@Mapper
public interface GoodsApplyDao extends BaseDao<GoodsApplyEntity> {


    List<GoodsApplyVo> queryListVo(GoodsApplyVo goodsApplyVo);

    GoodsApplyVo getVo(Long id);

    List<GoodsApplyVo> findByUserId(@Param("userId") Long userId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    BigDecimal sumAmount(@Param("date") Date date, @Param("userId") Long userId);

    BigDecimal sumAmountByPid(@Param("date") Date date, @Param("userId") Long userId);

    List<GoodsApplyVo> findByPid(@Param("userId") Long userId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    Integer sumCheck(Long userId);
}
